# -*- coding: utf-8 -*-
#
# File: viagem.py
#
# Copyright (c) 2007 by CTEC
# Generator: ArchGenXML Version 1.5.0
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#

__author__ = """CTEC <joaojoao@gmail.com>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.ibictn.content.formulario import formulario
from Products.Archetypes.SQLStorage import *
from Products.ibictn.config import *

# additional imports from tagged value 'import'
import DateTime
from Products.ibictn.Widgets import MonetaryWidget

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='cpf',
        widget=StringWidget(
            label="CPF",
            description="",
            label_msgid='ibictn_label_cpf',
            description_msgid='ibictn_help_cpf',
            i18n_domain='ibictn',
        )
    ),

    StringField(
        name='cargo',
        widget=StringWidget(
            label="Cargo",
            description="",
            label_msgid='ibictn_label_cargo',
            description_msgid='ibictn_help_cargo',
            i18n_domain='ibictn',
        )
    ),

    StringField(
        name='objetivo',
        widget=StringWidget(
            label="Objetivo",
            description="objetivo da viagem",
            label_msgid='ibictn_label_objetivo',
            description_msgid='ibictn_help_objetivo',
            i18n_domain='ibictn',
        )
    ),

    StringField(
        name='roteiro',
        widget=StringWidget(
            label="Roteiro",
            description="lista de cidades",
            label_msgid='ibictn_label_roteiro',
            description_msgid='ibictn_help_roteiro',
            i18n_domain='ibictn',
        )
    ),

    FloatField(
        name='valor',
        default="0.00",
        widget=MonetaryWidget(
            label="Valor da passagem",
            description="",
            label_msgid='ibictn_label_valor',
            description_msgid='ibictn_help_valor',
            i18n_domain='ibictn',
        )
    ),

    DateTimeField(
        name='saida',
        widget=CalendarWidget(
            label="Saída",
            description="",
            label_msgid='ibictn_label_saida',
            description_msgid='ibictn_help_saida',
            i18n_domain='ibictn',
        )
    ),

    StringField(
        name='cia_saida',
        widget=StringWidget(
            label="Vôo de saída e companhia aérea",
            description="",
            label_msgid='ibictn_label_cia_saida',
            description_msgid='ibictn_help_cia_saida',
            i18n_domain='ibictn',
        )
    ),

    DateTimeField(
        name='retorno',
        widget=CalendarWidget(
            label="Retorno",
            description="",
            label_msgid='ibictn_label_retorno',
            description_msgid='ibictn_help_retorno',
            i18n_domain='ibictn',
        )
    ),

    StringField(
        name='cia_retorno',
        widget=StringWidget(
            label="Vôo de retorno e companhia aérea",
            description="",
            label_msgid='ibictn_label_cia_retorno',
            description_msgid='ibictn_help_cia_retorno',
            i18n_domain='ibictn',
        )
    ),

    IntegerField(
        name='diarias',
        widget=IntegerWidget(
            label="Quantidade de diárias",
            description="",
            label_msgid='ibictn_label_diarias',
            description_msgid='ibictn_help_diarias',
            i18n_domain='ibictn',
        )
    ),

    TextField(
        name='descricao',
        allowable_content_types=('text/plain', 'text/structured', 'text/html', 'application/msword',),
        widget=RichWidget(
            label="Descrição",
            description="descrição das atividades realizadas",
            label_msgid='ibictn_label_descricao',
            description_msgid='ibictn_help_descricao',
            i18n_domain='ibictn',
        ),
        default_output_type='text/html'
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

viagem_schema = BaseSchema.copy() + \
    getattr(formulario, 'schema', Schema(())).copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class viagem(formulario, BaseContent):
    """
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(formulario,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)

    # This name appears in the 'add' box
    archetype_name = 'Relatório de Viagem'

    meta_type = 'viagem'
    portal_type = 'viagem'
    allowed_content_types = [] + list(getattr(formulario, 'allowed_content_types', []))
    filter_content_types = 0
    global_allow = 1
    #content_icon = 'viagem.gif'
    immediate_view = 'base_view'
    default_view = 'base_view'
    suppl_views = ()
    typeDescription = "Relatório de Viagem"
    typeDescMsgId = 'description_edit_viagem'
    allow_discussion = 1

    _at_rename_after_creation = True

    schema = viagem_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods


registerType(viagem, PROJECTNAME)
# end of class viagem

##code-section module-footer #fill in your manual code here
##/code-section module-footer



